const {task, src, series, dest, parallel} = require("gulp");
const sass = require("gulp-sass")(require("sass"));
const minifyCss = require("gulp-clean-css");
const renameCss = require("gulp-rename");
const autoprefixer = require("gulp-autoprefixer");
const path = require("path")
const notify = require("gulp-notify")
const clean = require("gulp-clean")
const startClean = function(cb) {
    src("./theme/*.css")
    .pipe(clean())
    cb()
  };
  

const style = function (cb) {
    src("./src/styles/*.scss")
    .pipe(sass())
    .pipe(autoprefixer())
    .pipe(minifyCss())
    .pipe(renameCss("index.css"))
    .pipe(dest("theme"))
    cb()
}

const build = series(startClean, parallel(style));

task('build', build)